package cn.tedu.review;
/*匿名内部类*/
public class TestInner2 {
    public static void main(String[] args) {
        new Inter1().eat();
        new Inter1().play();
        new Inter2() {
            @Override
            public void get() {
                System.out.println("匿名内部类来实现抽象方法");
            }
        }.get();
        new Inter3() {
            @Override
            public void add() {
                System.out.println("add方法");
            }

            @Override
            public void delete() { }
        }.add();



    }
}

class Inter1{
    public void eat(){
        System.out.println("再忙也要吃早餐");
    }
    public void play(){
        System.out.println("玩代码");
    }
}
abstract class Inter2{
    public void show(){
        System.out.println("抽象类的普通方法");
    }
    public abstract void get();
}
interface Inter3{
    void add();
    void delete();
}